class SaleBidResultManufactor {
  String? id;
  String? resultId; //结果id
  String? bidmanufactor; //参与厂家
  num? tenderOffer; //投标报价
  num? priceScore; //价格得分
  num? bidaranking; //中标名次
  num? bidamount; //中标金额
  num? bidshare; //中标份额

  SaleBidResultManufactor({
    this.id,
    this.resultId,
    this.bidmanufactor,
    this.tenderOffer,
    this.priceScore,
    this.bidaranking,
    this.bidamount,
    this.bidshare,
  });
  @override
  String toString() {
    return '''SaleBidResultManufactor{
      id: $id,
      resultId: $resultId,
      bidmanufactor: $bidmanufactor,
      tenderOffer: $tenderOffer,
      priceScore: $priceScore,
      bidaranking: $bidaranking,
      bidamount: $bidamount,
      bidshare: $bidshare,
    }''';
  }

  factory SaleBidResultManufactor.fromMap(Map<String, dynamic> map) {
    return new SaleBidResultManufactor(
      id: map['id'] != false ? map['id'].toString() as String? : "",
      resultId: map['result_id'] != false
          ? map['result_id'].toString() as String?
          : "",
      bidmanufactor: map['bidmanufactor'] != false
          ? map['bidmanufactor'].toString() as String?
          : "",
      tenderOffer: map['tender_offer'] != false ? map['tender_offer'] : null,
      priceScore: map['price_score'] != false ? map['price_score'] : null,
      bidaranking: map['bidaranking'] != false ? map['bidaranking'] : null,
      bidamount: map['bidamount'] != false ? map['bidamount'] : null,
      bidshare: map['bidshare'] != false ? map['bidshare'] : null,
    );
  }
  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'resultId': this.resultId,
      'bidmanufactor': this.bidmanufactor,
      'tenderOffer': this.tenderOffer,
      'priceScore': this.priceScore,
      'bidaranking': this.bidaranking,
      'bidamount': this.bidamount,
      'bidshare': this.bidshare,
    } as Map<String, dynamic>;
  }

  List toDomainList() {
    // ignore: unnecessary_cast
    List list = [
      if (this.resultId != null && this.resultId != '')
        ['result_id', '=', int.parse(this.resultId!)],
    ] as List;
    return list;
  }

  Map<String, dynamic> toOdooMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'result_id': this.resultId,
      'bidmanufactor': this.bidmanufactor,
      'tender_offer': this.tenderOffer,
      'price_score': this.priceScore,
      'bidaranking': this.bidaranking,
      'bidamount': this.bidamount,
      'bidshare': this.bidshare,
    } as Map<String, dynamic>;
  }
}
